﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Web;
using DHQGHN.DAL.Models.DanhMuc;
using DHQGHN.DAL.Models.TDT;

namespace DHQGHN.Services.TDT
{
    [ServiceContract]
    public interface IAreaService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetNewListsTablet/{lastUpdated}"
            )]
        IEnumerable<AREA> GetNewListsTablet(string lastUpdated);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="eaCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAll")]
        IEnumerable<DAL.Models.TDT.Area> GetAll();

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByUserName/{UserName}")]
        List<PM3_AREA> GetByUserNamePM3(string UserName);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="eaCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllPaging/{pageSize}/{pageIdx}")]
        IEnumerable<DAL.Models.TDT.Area> GetAllPaging(string pageSize, string pageIdx);

        /// <summary>
        /// gopro:20150508: get danh sach dia ban dieu tra theo ma khu vuc hanh chinh
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIdx"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByAdminCode/{adminCode}")]
        IEnumerable<DAL.Models.TDT.Area> GetByAdminCode(string adminCode);

        /// <summary>
        /// gopro:20150722: get danh sach dia ban dieu tra theo ma khu vuc hanh chinh. //quvd
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIdx"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllUsername/{UserName}")]
        IEnumerable<DAL.Models.TDT.Area> GetByUserName(string UserName);

        /// <summary>
        /// Datlq, get danh sach dia ban dieu tra theo ma khu vuc hanh chinh de mapping voi dieu tra vien
        /// </summary>
        /// <param name="adminCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByAdminCode_MappingEnum/{adminCode}/{enumID}")]
        IEnumerable<DAL.Models.TDT.Area> GetByAdminCode_MappingEnum(string adminCode, string enumID);

        /// <summary>
        /// Datlq, get danh sach dia ban dieu tra theo ma khu vuc hanh chinh de mapping voi dieu tra vien
        /// </summary>
        /// <param name="adminCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByAdminCode_NotMappingEnum/{adminCode}/{enumID}")]
        IEnumerable<DAL.Models.TDT.Area> GetByAdminCode_NotMappingEnum(string adminCode, string enumID);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="areaID"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByID/{areaID}"
            )]
        DAL.Models.TDT.Area GetByID(string areaID);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="household"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "AddArea")]
        void AddArea(DAL.Models.TDT.Area ea);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="householdID"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteArea")]
        void DeleteArea(string eaID);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="customer"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "EditArea")]
        void EditArea(DAL.Models.TDT.Area ea);
        /// <summary>
        /// phunx1, 20150514: ham luu toa do ranh gioi dia ban dieu tra
        /// </summary>
        /// <param name="ea"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "AddAreaBoundPoint")]
        void AddAreaBoundPoint(string arrPoints);
        /// <summary>
        /// phunx1: 20150529: method lay danh sach toa do ranh gioi theo dia ban dieu tra
        /// </summary>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAreaBoundPointByAreaCode/{areaCode}"
            )]
        IEnumerable<DAL.Models.TDT.AreaBoundPointMD> GetAreaBoundPointByAreaCode(string areaCode);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "SearchArea")]
        List<Area> SearchArea(SearchAreaModel search);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetForMapping")]
        List<DAL.Models.TDT.Area> GetForMapping(GetAreaConvert obj);
        /// <summary>
        /// nguoi tao: namdt
        /// ngay tao: 11.06.2015
        /// Muc dich: Get list Area by Admin Code
        /// </summary>
        /// <param name="code"></param>
        /// <param name="levels"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByADMUnitCode/{AdmUnitCode}"
            )]
        List<AREA> GetByADMUnitCode(string AdmUnitCode);


        /// <summary>
        /// quyvd, kiểm tra tên địa bàn đã có hay chưa 11082015
        /// </summary>
        /// <param name="adminCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "CheckForAreaName/{AREA_NAME}/{adm_unit_id}/{AREA_ID}")]
        bool CheckForAreaName(string AREA_NAME, string adm_unit_id, string AREA_ID);
    }
}